-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[multi-ASIC] BGP internal neighbor table support #5520
[multi-ASIC] BGP internal neighbor table support #5520
Conversation
dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2
Outdated
Show resolved
Hide resolved
46dc4ca
to
6fd60a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add tests for the new templates and update tests for the old?
6fd60a6
to
2b15a57
Compare
Can you please add template tests data in src/sonic-bgpcfgd/tests/data ? |
@pavel-shirshov I updated/added tests here in my earlier commit 2b15a57. But let me check if I need to cover more scenarios |
retest this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd better remove not required entries.
src/sonic-bgpcfgd/tests/data/general/instance.conf/param_all_v4.json
Outdated
Show resolved
Hide resolved
src/sonic-bgpcfgd/tests/data/general/instance.conf/param_all_v6.json
Outdated
Show resolved
Hide resolved
src/sonic-bgpcfgd/tests/data/general/peer-group.conf/param_base.json
Outdated
Show resolved
Hide resolved
src/sonic-bgpcfgd/tests/data/general/policies.conf/param_all.json
Outdated
Show resolved
Hide resolved
src/sonic-bgpcfgd/tests/data/general/policies.conf/param_deny.json
Outdated
Show resolved
Hide resolved
d0838bd
to
a89643d
Compare
retest this please |
retest vsimage please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@arlakshm , Could you take a look as well ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, couple of minor comments
! | ||
neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} | ||
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} | ||
! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, should add the lines to add the timer configuration if they are not default.
These configuration
https://github.com/Azure/sonic-buildimage/blob/09d5a62fad22313b29afe1419d329abe45fbef6d/dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2#L6-L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will update. As discussed will raise a follow up PR for adding this change.
neighbor {{ neighbor_addr }} peer-group INTERNAL_PEER_V4 | ||
! | ||
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} | ||
neighbor {{ neighbor_addr }} route-map FROM_BGP_INTERNAL_PEER_V4 in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is route-map configuration line repeated? The same line present in the peer_group.conf.j2 configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at both .. they are not same.
Here we set it per neighbor_ip_address, while in the peer_group.conf.j2 it is set on the peer group -- similar to how it was done before as well.
- Why I did it Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table. Additionally to address the review comment #5520 (comment) Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up. Updates to the internal tests data + add all of it to template tests. - How I did it Updated the APIs and the template files. - How to verify it Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
…c-net#5760) - Why I did it Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table. Additionally to address the review comment sonic-net#5520 (comment) Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up. Updates to the internal tests data + add all of it to template tests. - How I did it Updated the APIs and the template files. - How to verify it Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
* Initial commit for BGP internal neighbor table support. > Add new template named "internal" for the internal BGP sessions > Add a new table in database "BGP_INTERNAL_NEIGHBOR" > The internal BGP sessions will be stored in this new table "BGP_INTERNAL_NEIGHBOR" * Changes in template generation tests with the introduction of internal neighbor template files.
- Why I did it Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table. Additionally to address the review comment #5520 (comment) Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up. Updates to the internal tests data + add all of it to template tests. - How I did it Updated the APIs and the template files. - How to verify it Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
* Initial commit for BGP internal neighbor table support. > Add new template named "internal" for the internal BGP sessions > Add a new table in database "BGP_INTERNAL_NEIGHBOR" > The internal BGP sessions will be stored in this new table "BGP_INTERNAL_NEIGHBOR" * Changes in template generation tests with the introduction of internal neighbor template files.
…c-net#5760) - Why I did it Update the routine is_bgp_session_internal() by checking the BGP_INTERNAL_NEIGHBOR table. Additionally to address the review comment sonic-net#5520 (comment) Add timer settings as will in the internal session templates and keep it minimal as these sessions which will always be up. Updates to the internal tests data + add all of it to template tests. - How I did it Updated the APIs and the template files. - How to verify it Verified the internal BGP sessions are displayed correctly with show commands with this API is_bgp_session_internal()
Reintroduce the msft templates for multi-asic(3164) after the following sonic public PR's ( for internal BGP neighbors) are available in internal-201911 branch. sonic-net#5520 sonic-net#5760 sonic-net/sonic-swss-common#389 sonic-net/sonic-utilities#1224 How did I verify ----------------- 1. Verified the external and internal BGP sessions are up, shown correctly in "show ip bgp summary -d all" and show ip interface commands. 2. Ran related 3164 tests to make sure it is passing. bgp/test_bgp_fact.py::test_bgp_facts[0-0] PASSED [ 16%] bgp/test_bgp_fact.py::test_bgp_facts[0-1] PASSED [ 33%] bgp/test_bgp_fact.py::test_bgp_facts[0-2] PASSED [ 50%] bgp/test_bgp_fact.py::test_bgp_facts[0-3] PASSED [ 66%] bgp/test_bgp_fact.py::test_bgp_facts[0-4] PASSED [ 83%] bgp/test_bgp_fact.py::test_bgp_facts[0-5] PASSED [100%] bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[0] PASSED [ 57%] bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[1] PASSED [ 63%] bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[2] SKIPPED [ 68%] bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[3] SKIPPED [ 73%] bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[4] SKIPPED [ 78%] bgp/test_bgp_multipath_relax.py::test_bgp_multipath_relax[5] SKIPPED [ 84%]
- Why I did it
Introduce a new table for BGP internal neighbor sessions which will be used in case of multi-asic platforms for the IBGP sessions between the BGP instances running in namespaces mapped to ASIC. This is the follow up of the comments added for a fix earlier to create internal BGP peer group ( #4620 (comment) )
- How I did it
Updated the minigraph parsing logic to get the bgp_internal_sessions
- How to verify it
Checked the DB to find that the BGP_INTERNAL_NEIGHBOR table is populated with internal BGP neigibors.
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)